<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="zh-CN" lang="zh-CN"> 
<head>
	<!-- INCLUDE meta.html -->
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
<body>
<div class='main'>

<div class="headerdiv">
	<!-- INCLUDE header.html -->
</div>

<div id='content'>
	<div id='left'>
    	<div style="margin:10px;margin-top:30px;">
        	<ul>

            </ul>
    		
        </div>
    </div>
    <div id='maindiv'>
    	<div class="description">
			{page_description}
        </div>
        
        <!-- IF err_msg -->
        <div class="err_msg pad">
        	{err_msg}
        </div>
        <!-- ENDIF -->
        
        <!-- IF success_msg -->
        <div class="success_msg pad">
        	{success_msg}
        </div>
        <!-- ENDIF -->
        
        <div class="real_content">
        <button onclick="new_config()">{CONFIG_NEW}</button>
       	<br />
            	<fieldset id='config_area'>
               	<legend>{CONFIG}</legend>
                	<table cellpadding="0" cellspacing="3" border="0">
                    	<thead>
                        	<th>{CONFIG_NAME}</th>
                            <th>{CONFIG_DESCRIPTION}</th>
                            <th>{CONFIG_VALUE}</th>
                            <th style="width:120px;">{OPTIONS}</th>
                        </thead>
                        <tbody>
					<!-- BEGIN config_list -->
                    	<tr>
                        	<td>
                    			<input type="text" id="config_{config_id}" value="{name}" class="inputtext" disabled="disabled" />
                            </td>
                            <td>
                            	<input type="text" id="config_description_{config_id}" value="{description}" class="inputtext" style="width:200px;" />
                            </td>
                            <td><input id="config_value_{config_id}"  class="inputtext" style="width:200px;" value="{value}" />
                            </td>
                            <td>
                        		<button onclick="update_config({config_id})">{CONFIG_UPDATE}</button> <button onclick="delete_config({config_id})">{CONFIG_DELETE}</button>
							</td>
                        </tr>
                     <!-- END -->
                     </tbody>
                     </table>
                </fieldset>
                <br />
                <br />
                <br />


        </div>
        
    </div>
</div>

<script>
function new_config()
{
	var html = '<input type="text" id="config_0" class="inputtext" /> ';
	html += '<input id="config_description_0"  class="inputtext" style="width:200px;" /> ';	
	html += '<input id="config_value_0"  class="inputtext" style="width:200px;" /> ';
	html+= '<button onclick="update_config(0)">{CONFIG_UPDATE}</button>&nbsp;<br />';
	$_('config_area').innerHTML += html;
}
function delete_config(id)
{
	var url = "index.php?p=config&m=delete&config_id="+id;
	window.location=url;
}
function update_config(id)
{
	var name = $_('config_'+id).value;
	var value = $_('config_value_'+id).value;
	var description = $_('config_description_'+id).value
	var url = "index.php?p=config&m=set&name="+encodeURIComponent(name)+'&value='+encodeURIComponent(value)+'&description='+encodeURIComponent(description);
	window.location=url;
}
</script>

<!-- INCLUDE footer.html -->

</div>
</body>
</html>